package bTree.LeetCode;

public class 总时间可被60整除的对数 {
    public int numPairsDivisibleBy60(int[] time) {
        int cnt=0;
        //1.用数组来记录对60的余数
        int []nums=new int[60];
        for (int i : time) {
            i%=60;
            if (i!=0){
                cnt+=nums[60-i];
                nums[i]++;
            }else {
                cnt+=nums[0];
                nums[0]++;
            }
        }
        return cnt;
    }
}